<div class="articles form">
<?php echo $this->Form->create('Article', array('type' => 'file'));?>
	<fieldset>
		<legend><?php echo __('Edit Sample Article'); ?></legend>
	<?php        
		echo $this->Form->input('id');
		echo $this->Form->input('title',array('type' => 'text'));		
		echo $this->Form->input('summary');
                if(!isset($this->data['Media'][0]['id'])){
                    echo $this->Form->input('filename', array('type' => 'file'));
                }else{                
                    echo $this->Html->div('input text current-file',
                        __('<span class="lb-file-name">Current file: </span>') . $this->Html->link(@$this->data['Media'][0]['filename'],array('controller' => 'media', 'action' => 'viewFile', @$this->data['Media'][0]['id']), array('class' => 'pdf-icon'))
                        . $this->Html->link(__('Change file'), array('controller' => 'media', 'action' => 'changeFile', @$this->data['Media'][0]['id'], 'admin' => true), array('class' => 'link-change-file btn'))
                    );
                }
                echo $this->Form->input('status',array('options' => array('0' => 'Offline', '1' => 'Online')));
		echo $this->Form->hidden('type');				
		echo $this->Form->hidden('user_id');
                echo $this->Form->hidden('Media.id', array('value' => @$this->data['Media'][0]['id']));
	?>
	</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
